package Listeners;

import View.*;
import Model.*;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JLabel;

public class CoordListener implements ActionListener {

    ViewMap view;
    ModelMap model;

    public CoordListener(ViewMap view, ModelMap model) {
        this.view = view;
        this.model = model;
    }

    public void actionPerformed(ActionEvent e) {

        this.view.content.repaint();
        JLabel la = new JLabel("mda");
        this.view.content.add(la);
        try {
            System.out.println("coordonate");
            ResultSet coordonate = null;
            coordonate = this.model.getCoordonateStatii();
            while (coordonate.next()) {
                System.out.println("abs:"+coordonate.getString("abs"));
                System.out.println("ord:"+coordonate.getString("ord"));
                Point lineStart = new Point(10, 10);
               
            }
        } catch (SQLException ex) {
            Logger.getLogger(CoordListener.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
